package com.woohua.demo.command;

import java.util.ArrayList;
import java.util.List;

/***
 * @title Broker
 * @description: 代理人
 * @author baiji
 * @version 1.0.0
 * @create 2023/6/5 11:28
 **/
public class Broker {

    private List<Order> orderList = new ArrayList<>();

    public void takeOrder(Order order) {
        orderList.add(order);
    }

    public void placeOrders() {
        for (Order order : orderList) {
            order.execute();
        }
        orderList.clear();
    }

}
